package com.medical.data.vo;


import cn.hutool.core.util.BooleanUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.medical.data.annotations.FormItemTypeValidate;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class AddFormItemVo {


    @NotBlank(message = "表单id不可为空")
    @ApiModelProperty(value = "表单id")
    private String formTemplateId;

    @NotBlank(message = "组件key不可为空")
    @ApiModelProperty(value = "组件key")
    private String formItemId;

    @NotBlank(message = "标题不可为空")
    @ApiModelProperty(value = "标题不能为空")
    private String label;

    @NotBlank(message = "表单类型不可为空")
    @FormItemTypeValidate(message = "输入表单类型错误")
    @ApiModelProperty(value = "输入型，选择型等")
    private String itemType;

    @NotNull(message = "是否为必填不可为空")
    @ApiModelProperty(value = "true，false为非必填")
    private Boolean required;

    @ApiModelProperty(value = "提示型数据")
    private String placeholder;

    @ApiModelProperty(value = "表单样式")
    private Map<String, Object> scheme;

    @ApiModelProperty(value = "正则表达式")
    private List<Map<String, Object>> regList;

    @ApiModelProperty(value = "展示类型组件")
    private Boolean isDisplayType;

    @ApiModelProperty(value = "隐藏类型组件")
    private Boolean isHideType;

    @ApiModelProperty(value = "特殊处理类型")
    private Boolean isSpecialType;

    @NotNull(message = "是否显示标签不可为空")
    @ApiModelProperty(value = "是否显示标签")
    private Boolean showLabel;

    @ApiModelProperty(value = "表单项默认值")
    private String defaultValue;


    @ApiModelProperty(value = "排序")
    private Long sort;

    @NotNull(message = "栅格宽度不可为空")
    @ApiModelProperty(value = "栅格宽度")
    private Integer span;


}
